﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GenericGA.extrandom;

namespace GenericGA.generationmaker
{
    /// <summary>
    /// A class for producing a new generation given the current population generation of candidate solutions with the aim of searching for the best solution.
    /// </summary>
    /// <typeparam name="P">The phenotype type, or type of the candidate solutions.</typeparam>
    public abstract class GenerationMaker<P>
    {

        /// <summary>
        /// Given the current population generation, generate the next generation's chromosomes.
        /// </summary>
        /// <param name="currGeneration">The current generation.</param>
        /// <param name="phenotypeBuildingFunction">A phenotype building function for the creation of individuals from new chromosomes.</param>
        /// <param name="fitnessFunction">A fitness function for the selection of individuals from current generation.</param>
        /// <returns>The next generation's chromosomes.</returns>
        public abstract List<List<ulong>> NextGeneration(List<Individual<P>> currGeneration, GA<P>.PhenotypeBuildingFunctionType phenotypeBuildingFunction, GA<P>.FitnessFunctionType fitnessFunction);
        
    }
}
